package com.yigo.framework.base;

import lombok.Setter;

import java.util.*;

/**
 * @author chenzl105
 */
@Setter
public class BasePageQuery {
    private final int DEFAULT_PAGE_SIZE = 10;
    private final int DEFAULT_PAGE_NUM = 1;
    private Integer pageSize;
    private Integer pageNum;

    public Integer getPageSize() {
        return Optional.ofNullable(pageSize).orElse(DEFAULT_PAGE_SIZE);
    }

    public Integer getPageNum() {
        return Optional.ofNullable(pageNum).orElse(DEFAULT_PAGE_NUM);
    }
}
